package cn.cjxy.springmvcdemo1.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloController implements Controller {

	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		//获取请求参数
		//参数验证
		//调用service进行业务逻辑处理
		//返回jsp页面视图

        ModelAndView modelAndView = new ModelAndView();
        //设置模型  k-v
        modelAndView.addObject("message", "Hello World");
        //设置视图
        modelAndView.setViewName("/WEB-INF/a_hello/helloworld.jsp");
        //返回模型和视图
        return modelAndView;
	}
}